from flaskDemo.sql.mysql_db import mysql_db
# 用户注册
# 先获取一级菜单
# 在根据一级菜单的查看按钮权限，判断一级菜单是否有权限查看 以此类推
def register(menu_type,pid):
    sql = f"select * from system_menu where menu_type = {menu_type} and pid = {pid}"
    with mysql_db() as db:
        result = db.fetch_all(sql)
        for item in result:
            sql = f"select * from system_menu where pid = %s and permissions like '%%show'"
            print(item['id'])
            itemShow = db.fetch_one(sql, item['id'])
            print(itemShow)


if __name__ == "__main__":
    print(12)
